package com.example.prison.mapper;

import com.example.prison.entity.MapInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author jiang
* @description 针对表【map_info】的数据库操作Mapper
* @createDate 2023-05-30 11:29:22
* @Entity com.example.prison.entity.MapInfo
*/
@Mapper
public interface MapInfoMapper extends BaseMapper<MapInfo> {

    @Select("select * from map_info order by id desc")
    List<MapInfo> get();

    @Select("select * from map_info order by id desc")
    MapInfo getOne();

    @Insert("insert into map_info(name, url) " +
            "values (#{name}, #{url})")
    int add(MapInfo map);

    @Delete("<script>delete from map_info where id in <foreach collection=\"ids\" item=\"item\" open=\"(\" separator=\",\" close=\")\">#{item} </foreach> </script>")
    void deleteMap(@Param("ids") Integer[] ids);

    @Delete("delete from map_info where id=#{id}")
    void deleteMapById(@Param("id") Integer id);

}




